﻿USE [master]
GO
CREATE LOGIN [HomeDataUser] WITH PASSWORD=N'HomeData', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
CREATE DATABASE [HomeData] ON  PRIMARY 
( NAME = N'HomeData', FILENAME = N'F:\Data\HomeData.mdf' , SIZE = 10240KB , FILEGROWTH = 10240KB ), 
 FILEGROUP [FG_CORE] 
( NAME = N'HomeData_Core_1', FILENAME = N'F:\Data\HomeData_Core_1.ndf' , SIZE = 10240KB , FILEGROWTH = 10240KB ), 
 FILEGROUP [FG_FINANCE] 
( NAME = N'HomeData_Finance_1', FILENAME = N'F:\Data\HomeData_Finance_1.ndf' , SIZE = 10240KB , FILEGROWTH = 10240KB ), 
 FILEGROUP [FG_INDEXES] 
( NAME = N'HomeData_Indexes_1', FILENAME = N'F:\Data\HomeData_Indexes_1.ndf' , SIZE = 10240KB , FILEGROWTH = 10240KB )
 LOG ON 
( NAME = N'HomeData_log', FILENAME = N'F:\Log\HomeData_log.ldf' , SIZE = 10240KB , FILEGROWTH = 10240KB )
GO
ALTER DATABASE [HomeData] SET COMPATIBILITY_LEVEL = 100
GO
ALTER DATABASE [HomeData] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [HomeData] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [HomeData] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [HomeData] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [HomeData] SET ARITHABORT OFF 
GO
ALTER DATABASE [HomeData] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [HomeData] SET AUTO_CREATE_STATISTICS ON 
GO
ALTER DATABASE [HomeData] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [HomeData] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [HomeData] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [HomeData] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [HomeData] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [HomeData] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [HomeData] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [HomeData] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [HomeData] SET  DISABLE_BROKER 
GO
ALTER DATABASE [HomeData] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [HomeData] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [HomeData] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [HomeData] SET  READ_WRITE 
GO
ALTER DATABASE [HomeData] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [HomeData] SET  MULTI_USER 
GO
ALTER DATABASE [HomeData] SET PAGE_VERIFY CHECKSUM  
GO
USE [HomeData]
GO
IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [HomeData] MODIFY FILEGROUP [PRIMARY] DEFAULT
GO
USE [HomeData]
GO
CREATE USER [HomeDataUser] FOR LOGIN [HomeDataUser]
GO
